<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::group(['namespace'=>'App'], function () {

        //用户模块
        Route::post('user/reg', 'UserController@reg');//用户注册
        Route::get('send/sms', 'UserController@sms');//发送手机验证码
        Route::get('sms/checkcode', 'UserController@checkcode');//验证验证码
        Route::post('user/login', 'UserController@login');//用户登录
        Route::post('user/find_pwd', 'UserController@find_pwd');//用户改变重置密码
        Route::post('user/set_info', 'UserInfoController@update_user_info');//用户设置资料
        Route::post('user/set_read_queque', 'UserInfoController@set_read_queque');//用户设置第一次阅读债权金协议
        Route::get('user/center', 'UserInfoController@personal_center');//用户个人中心
        Route::post('user/check', 'UserInfoController@realNameCheck');//实名认证
        Route::post('user/bind_shop', 'UserInfoController@bind_shop');//用户绑定店铺
        Route::post('user/editPayPwd', 'UserInfoController@editPayPwd');//设置修改支付密码
        Route::post('user/updateTel', 'UserInfoController@updateTel');//设置修改支付密码
        Route::get('user/share', 'UserController@share');//分享App

        Route::get('user/userdata', 'UserController@userData');//获取分享注册信息


        Route::get('user/userdata', 'UserController@userData');//分享App
        Route::get('user/encryption', 'UserController@encryption');//分享App


        //用户银行卡管理
        Route::get('card/list',         'CardController@cardList');//银行卡列表
        Route::get('cardType/list',     'CardController@cardTypeList');//银行卡类型列表
        Route::post('card/add',         'CardController@cardAdd');//银行卡添加
        Route::post('card/delete',      'CardController@cardDelete');//银行卡删除

        // 首页
        Route::get('index/index', 'IndexController@index');//banner和分类信息
        Route::get('index/goods', 'IndexController@goods');//展示商品

        // 分类页面
        Route::get('type/type', 'TypeController@type');//分类信息
        Route::get('type/goods', 'TypeController@goods');//展示商品

        // 队列商品
        Route::get('wares/list',        'WaresController@list');        // 商品列表
        Route::get('wares/info',        'WaresController@info');        // 商品详情(上部)
        Route::get('wares/content',     'WaresController@content');     // 商品介绍(下部)

        // 队列订单
        Route::get('lines/list',        'LinesController@list');                // 队列列表
        Route::get('lines/info',        'LinesController@info');                // 订单详情
        Route::post('lines/buy',        'LinesController@buy');                 // 购买下单
        Route::post('lines/pay',        'LinesController@pay');                 // 消费付款
        Route::get('lines/succ',        'LinesController@success');             // 业务处理
        Route::get('lines/test',        'LinesController@test');                // 支付测试
        Route::get('lines/testass',     'LinesController@testass');             // 计划任务助推测试

        // 队列信息
        Route::get('queue/info',        'QueueController@info');                // 队列详情
        Route::get('queue/protocol',    'QueueController@protocol');            // 队列协议
        Route::get('queue/info',        'QueueController@info');                // 队列详情
        Route::get('queue/shopinfo',    'QueueController@shopinfo');            // 绑定的商户信息

        //商品模块
        Route::get('goods/index', 'GoodsController@index');//商品详情上部
        Route::get('goods/content', 'GoodsController@content');//商品详情下部

        // 购物车
        Route::post('cart/create', 'CartController@create');//添加购物车
        Route::get('cart/show', 'CartController@show');//展示购物车
        Route::post('cart/del', 'CartController@del');//删除购物车商品
        Route::post('cart/edit', 'CartController@edit');//修改商品数量
        Route::get('cart/info', 'CartController@info');//获取提货信息

        //用户平台提现模块
        Route::post('widthDraw/widthDraw','WidthdrawSystemController@widthDraw');//申请提现
        Route::get('widthDraw/list',      'WidthdrawSystemController@widthdrawList');//交易流水
        Route::get('widthDraw/getBalance','WidthdrawSystemController@getInfo');//用户余额
        Route::get('aa/bb','WidthdrawSystemController@aa');//测试支付完成增加日志


        //支付模块
        Route::get('pay/list', 'PayController@payList');//支付功能

        Route::post('pay/aliapp',   'PayController@getAliPayAppSign');//支付宝支付获得签名
        Route::post('pay/wxapp',    'PayController@getWxAppSign');//微信支付获得签名
        Route::post('pay/sdurl',    'PayController@getSdUrl');//获得衫德的url
        Route::get('pay/sdpay',     'PayController@sdPay');//衫德支付
        Route::post('pay/balance',  'PayController@balanceZPay');//余额支付

        Route::post('pay/notifyWx', 'PayController@notifyWx');//微信支付回调
        Route::post('pay/notifyAli','PayController@notifyAli');//支付宝支付回调
        Route::post('pay/frontSd',   function() {
                    return view('index');
        });//衫德同步回调（用于浩博的页面）
        //Route::post('pay/frontSd','PayController@notifySd');
        Route::post('pay/notifsd','PayController@notifySd');//衫德异步回调
        
        /******测试路由*******/
        Route::get('pay/notifyAlis','PayController@notifyAli');//支付宝支付回调
        
        Route::get('pay/notifyWxs','PayController@notifyWx');//微信支付回调
        Route::get('pay/test','PayController@test');
       /******测试路由结束*******/

        Route::post('pay/result','PayController@checkResult');//支付完成结果审查

        // 订单模块
        Route::post('order/create', 'OrderController@create');//添加订单
        Route::get('order/show', 'OrderController@show');//展示订单
        Route::get('order/order', 'OrderController@orderShow');//订单详情
        Route::get('order/income', 'OrderController@income');//订单收益
        Route::post('order/goodorder', 'OrderController@goodOrder');//立即购买
        Route::get('order/getcode', 'OrderController@getcode');//立即购买

        // oss模块
        Route::get('oss/key', 'OssController@gegkey');//获取临时key

        //用户商户提现模块
        Route::post('widthDrawShop/widthDraw','WidthdrawShopController@widthDraw');//申请提现
        Route::get('widthDrawShop/list',      'WidthdrawShopController@widthdrawList');//用户商户交易流水
        // 测试
        Route::get('test/index', 'TestController@index');
        Route::get('test/bb', 'TestController@bb');
        Route::get('test/cc', 'TestController@cc');
        Route::get('test/dd', 'TestController@dd');


         //数据字典
        Route::get('dictionary/version', 'DictionaryController@version');//获取版本号
        Route::get('dictionary/data', 'DictionaryController@data');//获取数据字典




        //文章模块
        Route::get('article/detail', 'ArticleController@detail');    // 获取文章详情
        Route::get('article/list', 'ArticleController@list');    // 文章列表
        Route::get('article/cate_list', 'ArticleController@cate_list');    // 分类列表

        // 店铺模块
        Route::get('shop/operator',     'ShopController@operator');     // 获取运营者信息
        Route::get('shop/shopLists',    'ShopController@shopLists');    // 获取店铺列表
        
});